package com.doyled.jump.util;

public enum ChessKind {
	Red, Blue, Yellow, Green, None;
	
    public static ChessKind fromInteger(int x) {
        switch(x) {
        case 0:
            return Red;
        case 1:
            return Blue;
        case 2:
            return Yellow;
        case 3:
            return Green;
        case 4:
        	return None;
        }
        return None;
    }
    
    public static int toInteger(ChessKind x) {
        switch(x) {
        case Red:
            return 0;
        case Blue:
            return 1;
        case Yellow:
            return 2;
        case Green:
            return 3;
        case None:
        	return 4;
        }
        return 4;
    }
}
